/*
 * Copyright 2010 Alexey Romensky
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not
 * use this file except in compliance with the License. You may obtain a copy of
 * the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 * License for the specific language governing permissions and limitations under
 * the License.
 */

/*
 * User: Alexey Romensky
 * Date: 20.02.2010
 * Time: 20:06:26
 */
package com.googlecode.gwt.logging.api.client.impl;

import com.googlecode.gwt.logging.api.client.LogWriter;
import org.slf4j.Logger;
import org.slf4j.Marker;

public class Slf4jLoggerAdapter extends AbstractLogAdapter implements Logger {

    private static final String THIS_FILE_NAME = "Slf4jLoggerAdapter.java";

    private final String name;

    public Slf4jLoggerAdapter(LogWriter log, String name) {
        super(log);
        this.name = name;
    }

    @Override
    public String getName() {
        return name;
    }

    @Override
    public boolean isTraceEnabled() {
        return log.isTraceEnabled(null);
    }

    @Override
    public void trace(String msg) {
        log.trace(new Slf4jLogData(THIS_FILE_NAME, msg));
    }

    @Override
    public void trace(String format, Object arg) {
        log.trace(new Slf4jLogData(THIS_FILE_NAME, format, new Object[]{arg}));
    }

    @Override
    public void trace(String format, Object arg1, Object arg2) {
        log.trace(new Slf4jLogData(THIS_FILE_NAME, format, new Object[]{arg1, arg2}));
    }

    @Override
    public void trace(String format, Object[] argArray) {
        log.trace(new Slf4jLogData(THIS_FILE_NAME, format, argArray));
    }

    @Override
    public void trace(String msg, Throwable t) {
        log.trace(new Slf4jLogData(THIS_FILE_NAME, msg, t));
    }

    @Override
    public boolean isTraceEnabled(Marker marker) {
        return log.isTraceEnabled(marker);
    }

    @Override
    public void trace(Marker marker, String msg) {
        log.trace(new Slf4jLogData(THIS_FILE_NAME, marker, msg));
    }

    @Override
    public void trace(Marker marker, String format, Object arg) {
        log.trace(new Slf4jLogData(THIS_FILE_NAME, marker, format, new Object[]{arg}));
    }

    @Override
    public void trace(Marker marker, String format, Object arg1, Object arg2) {
        log.trace(new Slf4jLogData(THIS_FILE_NAME, marker, format, new Object[]{arg1, arg2}));
    }

    @Override
    public void trace(Marker marker, String format, Object[] argArray) {
        log.trace(new Slf4jLogData(THIS_FILE_NAME, marker, format, argArray));
    }

    @Override
    public void trace(Marker marker, String msg, Throwable t) {
        log.trace(new Slf4jLogData(THIS_FILE_NAME, marker, msg, t));
    }

    @Override
    public boolean isDebugEnabled() {
        return log.isDebugEnabled(null);
    }

    @Override
    public void debug(String msg) {
        log.debug(new Slf4jLogData(THIS_FILE_NAME, msg));
    }

    @Override
    public void debug(String format, Object arg) {
        log.debug(new Slf4jLogData(THIS_FILE_NAME, format, new Object[]{arg}));
    }

    @Override
    public void debug(String format, Object arg1, Object arg2) {
        log.debug(new Slf4jLogData(THIS_FILE_NAME, format, new Object[]{arg1, arg2}));
    }

    @Override
    public void debug(String format, Object[] argArray) {
        log.debug(new Slf4jLogData(THIS_FILE_NAME, format, argArray));
    }

    @Override
    public void debug(String msg, Throwable t) {
        log.debug(new Slf4jLogData(THIS_FILE_NAME, msg, t));
    }

    @Override
    public boolean isDebugEnabled(Marker marker) {
        return log.isDebugEnabled(marker);
    }

    @Override
    public void debug(Marker marker, String msg) {
        log.debug(new Slf4jLogData(THIS_FILE_NAME, marker, msg));
    }

    @Override
    public void debug(Marker marker, String format, Object arg) {
        log.debug(new Slf4jLogData(THIS_FILE_NAME, marker, format, new Object[]{arg}));
    }

    @Override
    public void debug(Marker marker, String format, Object arg1, Object arg2) {
        log.debug(new Slf4jLogData(THIS_FILE_NAME, marker, format, new Object[]{arg1, arg2}));
    }

    @Override
    public void debug(Marker marker, String format, Object[] argArray) {
        log.debug(new Slf4jLogData(THIS_FILE_NAME, marker, format, argArray));
    }

    @Override
    public void debug(Marker marker, String msg, Throwable t) {
        log.debug(new Slf4jLogData(THIS_FILE_NAME, marker, msg, t));
    }

    @Override
    public boolean isInfoEnabled() {
        return log.isInfoEnabled(null);
    }

    @Override
    public void info(String msg) {
        log.info(new Slf4jLogData(THIS_FILE_NAME, msg));
    }

    @Override
    public void info(String format, Object arg) {
        log.info(new Slf4jLogData(THIS_FILE_NAME, format, new Object[]{arg}));
    }

    @Override
    public void info(String format, Object arg1, Object arg2) {
        log.info(new Slf4jLogData(THIS_FILE_NAME, format, new Object[]{arg1, arg2}));
    }

    @Override
    public void info(String format, Object[] argArray) {
        log.info(new Slf4jLogData(THIS_FILE_NAME, format, argArray));
    }

    @Override
    public void info(String msg, Throwable t) {
        log.info(new Slf4jLogData(THIS_FILE_NAME, msg, t));
    }

    @Override
    public boolean isInfoEnabled(Marker marker) {
        return log.isInfoEnabled(marker);
    }

    @Override
    public void info(Marker marker, String msg) {
        log.info(new Slf4jLogData(THIS_FILE_NAME, marker, msg));
    }

    @Override
    public void info(Marker marker, String format, Object arg) {
        log.info(new Slf4jLogData(THIS_FILE_NAME, marker, format, new Object[]{arg}));
    }

    @Override
    public void info(Marker marker, String format, Object arg1, Object arg2) {
        log.info(new Slf4jLogData(THIS_FILE_NAME, marker, format, new Object[]{arg1, arg2}));
    }

    @Override
    public void info(Marker marker, String format, Object[] argArray) {
        log.info(new Slf4jLogData(THIS_FILE_NAME, marker, format, argArray));
    }

    @Override
    public void info(Marker marker, String msg, Throwable t) {
        log.info(new Slf4jLogData(THIS_FILE_NAME, marker, msg, t));
    }

    @Override
    public boolean isWarnEnabled() {
        return log.isWarnEnabled(null);
    }

    @Override
    public void warn(String msg) {
        log.warn(new Slf4jLogData(THIS_FILE_NAME, msg));
    }

    @Override
    public void warn(String format, Object arg) {
        log.warn(new Slf4jLogData(THIS_FILE_NAME, format, new Object[]{arg}));
    }

    @Override
    public void warn(String format, Object[] argArray) {
        log.warn(new Slf4jLogData(THIS_FILE_NAME, format, argArray));
    }

    @Override
    public void warn(String format, Object arg1, Object arg2) {
        log.warn(new Slf4jLogData(THIS_FILE_NAME, format, new Object[]{arg1, arg2}));
    }

    @Override
    public void warn(String msg, Throwable t) {
        log.warn(new Slf4jLogData(THIS_FILE_NAME, msg, t));
    }

    @Override
    public boolean isWarnEnabled(Marker marker) {
        return log.isWarnEnabled(marker);
    }

    @Override
    public void warn(Marker marker, String msg) {
        log.warn(new Slf4jLogData(THIS_FILE_NAME, marker, msg));
    }

    @Override
    public void warn(Marker marker, String format, Object arg) {
        log.warn(new Slf4jLogData(THIS_FILE_NAME, marker, format, new Object[]{arg}));
    }

    @Override
    public void warn(Marker marker, String format, Object arg1, Object arg2) {
        log.warn(new Slf4jLogData(THIS_FILE_NAME, marker, format, new Object[]{arg1, arg2}));
    }

    @Override
    public void warn(Marker marker, String format, Object[] argArray) {
        log.warn(new Slf4jLogData(THIS_FILE_NAME, marker, format, argArray));
    }

    @Override
    public void warn(Marker marker, String msg, Throwable t) {
        log.warn(new Slf4jLogData(THIS_FILE_NAME, marker, msg, t));
    }

    @Override
    public boolean isErrorEnabled() {
        return log.isErrorEnabled(null);
    }

    @Override
    public void error(String msg) {
        log.error(new Slf4jLogData(THIS_FILE_NAME, msg));
    }

    @Override
    public void error(String format, Object arg) {
        log.error(new Slf4jLogData(THIS_FILE_NAME, format, new Object[]{arg}));
    }

    @Override
    public void error(String format, Object arg1, Object arg2) {
        log.error(new Slf4jLogData(THIS_FILE_NAME, format, new Object[]{arg1, arg2}));
    }

    @Override
    public void error(String format, Object[] argArray) {
        log.error(new Slf4jLogData(THIS_FILE_NAME, format, argArray));
    }

    @Override
    public void error(String msg, Throwable t) {
        log.error(new Slf4jLogData(THIS_FILE_NAME, msg, t));
    }

    @Override
    public boolean isErrorEnabled(Marker marker) {
        return log.isErrorEnabled(marker);
    }

    @Override
    public void error(Marker marker, String msg) {
        log.error(new Slf4jLogData(THIS_FILE_NAME, marker, msg));
    }

    @Override
    public void error(Marker marker, String format, Object arg) {
        log.error(new Slf4jLogData(THIS_FILE_NAME, marker, format, new Object[]{arg}));
    }

    @Override
    public void error(Marker marker, String format, Object arg1, Object arg2) {
        log.error(new Slf4jLogData(THIS_FILE_NAME, marker, format, new Object[]{arg1, arg2}));
    }

    @Override
    public void error(Marker marker, String format, Object[] argArray) {
        log.error(new Slf4jLogData(THIS_FILE_NAME, marker, format, argArray));
    }

    @Override
    public void error(Marker marker, String msg, Throwable t) {
        log.error(new Slf4jLogData(THIS_FILE_NAME, marker, msg, t));
    }
}
